<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript" src="<%=basePath%>js/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/xadmin.js"></script>
<link rel="stylesheet" href="<%=basePath%>css/font.css">
<link rel="stylesheet" href="<%=basePath%>css/xadmin.css">
<link rel="stylesheet" href="<%=basePath%>lib/layui/css/layui.css"
	media="all">
<script src="<%=basePath%>lib/layui/layui.js" charset="utf-8"></script>
</head>
<body class="layui-anim layui-anim-up">
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a>分销审批</a> <a> <cite>导航元素</cite></a>
		</span>   <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height: 35px;"></i></a>
	</div>
	<table class="layui-table"
		lay-data="{url:'findDistrListPage.do', page:true, id:'test',toolbar:true,limits:[5,10,20,30,40,50,100,200,300,500,1000,1500,2000,4000,6000,10000,10000000] }"
		id="LAY-user-manage" lay-filter="test">
		<thead>
			<tr>
				<!-- <th lay-data="{checkbox: true, LAY_CHECKED: false, filter:'test'}"></th> -->
				<th lay-data="{field:'id'}">序号</th>
				<th lay-data="{field:'dOpenid'}">申请账号</th>
				<th lay-data="{field:'dSuperior'}">父级分销商ID</th>
				<th lay-data="{field:'dCreate'}">申请时间</th>
				<th lay-data="{field:'dDistributionIdentification'}">分销标识</th>
				<th lay-data="{field:'dLevelIdentification'}">分销等级</th>
			<!-- 	<th lay-data="{field:'cId'}">商品ID</th>
				<th lay-data="{field:'fCreateTime'}">成交时间</th> -->
				<th lay-data="{field:'button'}">操作</th>
			</tr>
		</thead>
	</table>
	<script type="text/javascript">
	$(function() {
		init();
	})
	function init() {
		layui.use('table', function() {
			var table = layui.table;
			table.render({
				height : 20
			});
		});
	}
	function table(type,id){
		if(type==2){
			 layer.confirm("确认了吗", { title: "狠心拒绝通过吗?" }, function (index) {
			     $.post("agreeToRefuse.do?dId="+id+"&type="+type, function (data) {
			     	if(data.type==1){
			     		layer.msg("操作成功");
			     		  var index = parent.layer.getFrameIndex(window.name);
		                   //关闭当前frame
		                   parent.layer.close(index);
		                   window.location.reload();
			     	}else{
			     		layer.msg("操作失败");
			     	}
			     },"json");
			 }); 
		}else{
			layer.confirm("确认了吗", { title: "确认审核通过吗" }, function (index) {
			     $.post("agreeToRefuse.do?dId="+id+"&type="+type, function (data) {
			     	if(data.type==1){
			     		layer.msg("操作成功");
			     	   var index = parent.layer.getFrameIndex(window.name);
	                   //关闭当前frame
	                   parent.layer.close(index);
	                   window.location.reload();
			     	}else{
			     		layer.msg("操作失败");
			     	}
			     },"json");
			 }); 
		}
		
	}
	</script>
</body>
</html>